<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>后台--文章管理</title>
    <link rel="stylesheet" type="text/css" href="<?php echo isset($skin)?$skin:"";?>images/style.css" />
    <base target="_self"/>

    <script src='<?php echo isset($skin)?$skin:"";?>js/jquery.min.js'></script>
    <script type="text/javascript" src="<?php echo isset($skin)?$skin:"";?>js/jquery.form.min.js"></script>
    <script type="text/javascript" src="<?php echo isset($skin)?$skin:"";?>js/dist/dialog-min.js"></script>
    <script src="<?php echo isset($skin)?$skin:"";?>js/admin.js"></script>
    <script type="text/javascript">
        <!--
        $(document).ready(function () {
            $('.new_table tbody tr:even').addClass('h'); //奇偶变色，添加样式
        });
        //-->
    </script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>/js/validate.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artTemplate.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artTemplate-plugin.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/form.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artDialog.js"></script>
<script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/iframeTools.js"></script>
<link rel="stylesheet" href="<?php echo isset($skin)?$skin:"";?>js/artdialog.css" type="text/css">
</head>
<body>
<div class="hh6"></div>
<div class="searchbar">
  <form action="?" method="get" name="searchListForm">
    <input type="hidden" name="c" value="goods">
    <select class="auto" name="search[category_id]">
      <option value="">选择分类</option>
      <?php if(is_array($catlist))  foreach($catlist as $v) { ?>
      <option value="<?php echo isset($v->cat_id)?$v->cat_id:"";?>" <?php if($category_id==$v->cat_id){?>selected="selected"<?php }?>><?php echo isset($v->cat_name)?$v->cat_name:"";?></option>
      <?php }?>
    </select>
    <select class="auto" name="search[is_on_sale]">
      <option value="">选择上下架</option>
      <option value="1" <?php if($is_on_sale==1){?>selected="selected"<?php }?>>上架</option>
      <option value="2" <?php if($is_on_sale==2){?>selected="selected"<?php }?>>下架</option>
      <option value="3" <?php if($is_on_sale==3){?>selected="selected"<?php }?>>待审</option>
    </select>
    <select class="auto" name="search[store_nums]">
      <option value="">选择库存</option>
      <option value="g.store_nums < 1">无货</option>
      <option value="g.store_nums >= 1 and g.store_nums < 10">低于10</option>
      <option value="g.store_nums <= 100 and g.store_nums >= 10">10-100</option>
      <option value="g.store_nums >= 100">100以上</option>
    </select>
    <select class="auto" name="search[commend_id]">
      <option value="">选择商品标签</option>
      <option value="1" <?php if($commend_id==1){?>selected="selected"<?php }?>>最新商品</option>
      <option value="2" <?php if($commend_id==2){?>selected="selected"<?php }?>>特价商品</option>
      <option value="3" <?php if($commend_id==3){?>selected="selected"<?php }?>>热卖商品</option>
      <option value="4" <?php if($commend_id==4){?>selected="selected"<?php }?>>推荐商品</option>
    </select>
    <button class="btn" type="submit" onclick="changeAction(false)"><span class="sel">筛 选</span></button>
    <!--<button class="btn" onclick="changeAction(true)"><span class="sel">导出Excel</span></button>-->
  </form>
</div>
<table class="new_table" width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
	<thead>
<tr class="n_bt"><td colspan="8" align="center">爱不语商城系统</td></tr>
  <tr>
  <td height="28" align="center"  class="thbt">栏目ID</td>
    <td height="28" align="center"  class="thbt">商品名称</td>
    <td height="28" align="center"  class="thbt">分类</td>
    <td height="28" align="center"  class="thbt">销售价</td>
    <td height="28" align="center"  class="thbt">库存</td>
    <td height="28" align="center"  class="thbt">状态</td>
    <td height="28" align="center"  class="thbt">排序</td>
    <td height="28" align="center"  class="thbt">管理选项</td>
 
  </tr></thead>

  <tbody id="goodsListBody"></tbody>
  <script id="goodsRowTemplate" type="text/html">
    <%for(var item in templateData){%>
    <%item = templateData[item]%>
    <tr width='4%' align="center" >
      <td><input name="id[]" type="checkbox" value="<%=item['id']%>"><%=item['id']%></td>
      <td height="20" align="left"><%=item['name']%></td>
      <td><%=item['cat_name']%></td>
      <td><%=item['sell_price']%></td>
      <td><%=item['store_nums']%></td>
      <td><% if (item['is_on_sale']==1){%>上架<%}else if(item['is_on_sale']==2){%>审核<%}else{%>下架<%}%></td>
      <td><%=item['sort']%></td>
      <td><a class="mod" href="?c=<?php echo isset($classname)?$classname:"";?>&a=info&id=<%=item['id']%>">修改</a>
        <a class="del" href="?c=<?php echo isset($classname)?$classname:"";?>&a=del&id=<%=item['id']%>">删除</a></td>
      </td>
    </tr>
    <%}%>
  </script>
</table>
<div class="pages"><?php echo isset($pagelist)?$pagelist:"";?></div>
<script type="text/javascript">
  $(function()
  {
    var t=<?php echo isset($goodslist)?$goodslist:"";?>;
    console.log(t);
    var goodsRowHtml = template.render('goodsRowTemplate',{'templateData':<?php echo isset($goodslist)?$goodslist:"";?>});
    $('#goodsListBody').html(goodsRowHtml);
  });
</script>
<script type="text/javascript">
    <!--
    $(document).ready(function () {
        $('.new_table tbody tr:even').addClass('h'); //奇偶变色，添加样式
    });
    //-->
</script>
</body>
</html>